/** @format */

import { createApp } from 'vue'
import { createPinia } from 'pinia'
// 导入 element-plus 的所有组件
import ElementPlus from 'element-plus'
// 导入 element-plus 组件的样式
import 'element-plus/dist/index.css'
import App from './App.vue'
// 导入 router 实例
import router from './router'
// 按需导入字体图标
import {
	User,
	Lock,
	PieChart,
	Notebook,
	SwitchButton,
	ArrowRight,
	Plus,
	View,
	Edit,
	Delete
} from '@element-plus/icons-vue'
// 导入 index.scss 样式模块
import './styles/index.scss'
// 导入富文本编辑器组件
import { QuillEditor } from '@vueup/vue-quill'
// 导入富文本编辑器组件样式
import '@vueup/vue-quill/dist/vue-quill.snow.css'

const app = createApp(App)
// 全局注册字体图标组件
app.component(User.name, User)
app.component(Lock.name, Lock)
app.component(PieChart.name, PieChart)
app.component(Notebook.name, Notebook)
app.component(SwitchButton.name, SwitchButton)
app.component(ArrowRight.name, ArrowRight)
app.component(Plus.name, Plus)
app.component(View.name, View)
app.component(Edit.name, Edit)
app.component(Delete.name, Delete)

// 全局注册富文本编辑器组件
app.component('QuillEditor', QuillEditor)
// 创建 pinia 实例
const pinia = createPinia()
// 注册 pinia
app.use(pinia)
// 注册 router
app.use(router)
// 全局注册 ElementPlus 的所有组件
app.use(ElementPlus)
app.mount('#app')
